home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Views / SolidFrame.cp < prev    next >
Text File  |  1997-06-28  |  993b  |  41 lines

  1. // SolidFrame.cp
  2.  
  3. #ifndef SolidFrame_h
  4. #include "SolidFrame.h"
  5. #endif
  6. #ifndef ForegroundColorMaintainer_h
  7. #include "ForegroundColorMaintainer.h"
  8. #endif
  9. #ifndef ViewMap_h
  10. #include "ViewMap.h"
  11. #endif
  12.  
  13. void SolidFrame::DrawBorder( const ViewMap& map, Rectangle interior ) const
  14.   {
  15.     ForegroundColorMaintainer cm( ForegroundColor() );
  16.     
  17.     Rectangle bounds( map.Bounds() );
  18.     Rectangle top( bounds.left, bounds.top, bounds.right, interior.top );
  19.     Rectangle bottom( bounds.left, interior.bottom, bounds.right, bounds.bottom );
  20.     Rectangle left( bounds.left, interior.top, interior.left, interior.bottom );
  21.     Rectangle right( interior.right, interior.top, bounds.right, interior.bottom );
  22.     
  23.     PaintRect( &top );
  24.     PaintRect( &left );
  25.     PaintRect( &right );
  26.     PaintRect( &bottom );
  27.   }
  28.  
  29. void SolidFrame::ForegroundColorChanged()
  30.   {
  31.     ViewMap map( *this );
  32.     
  33.     if ( !map.Visible() )
  34.         return;
  35.     
  36.     RegionObject region( map.Bounds() );
  37.     region -= Interior().Bounds();
  38.     
  39.     ViewMap( *this ).Invalidate( region );
  40.   }
  41.